﻿namespace NMortgage.UI.Tests
{
    using System;

    using FluentValidation.TestHelper;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using NMortgage.UI.Model;

    [TestClass]
    public class NormalValidatorTest
    {
        #region Properties

        private NormalDistributionValidator Subject
        {
            get;
            set;
        }

        #endregion Properties

        #region Methods

        [TestMethod]
        public void BetaDistributionValidatorConstructorTest()
        {
            NormalDistributionValidator target = new NormalDistributionValidator();
            Assert.IsNotNull(target);
        }

        [TestMethod]
        public void Should_have_error_for_any_property_0_or_less()
        {
            Subject.ShouldHaveValidationErrorFor(distribution => distribution.Mean, 0d);
            Subject.ShouldHaveValidationErrorFor(distribution => distribution.StdDev, 0d);
            Subject.ShouldHaveValidationErrorFor(distribution => distribution.Mean, -1d);
            Subject.ShouldHaveValidationErrorFor(distribution => distribution.StdDev, -1d);
        }

        [TestMethod]
        public void Should_have_error_for_mean_greater_than_30_1()
        {
            Subject.ShouldHaveValidationErrorFor(distribution => distribution.Mean, 30.1d);
        }

        [TestInitialize]
        public void TestInitialize()
        {
            Subject = new NormalDistributionValidator();
        }

        #endregion Methods
    }
}